GBML manual / Constants

EASE_BOUNCE_IN

Starts with small bounces that grow bigger and then rushes the last of the way - a dropped ball played backwards. Never goes outside the range from the start to the end.

Syntax

EASE_BOUNCE_IN: constant

Description

The "bounce in" curve for tween and tween_to: a bouncing ball played backwards. It starts with tiny hops off the start that get taller and taller, and then swings the rest of the way to the end. After a quarter of the time it is at 0.03, after half at 0.23, and after three quarters at 0.53.

It never goes outside the range

Unlike back and elastic, a bounce never goes outside the range from from to to. The hops go from from toward to and back, and nothing ever goes behind from or past to: it is safe to use on a number with limits. The three hops are about 1.5%, 6% and 25% of the distance, each one four times as tall as the one before.

It lands exactly on to and stays there: after the end the number is exactly to, every frame.

A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball drops to the green line like a dropped ball and bounces back up three times, each bounce smaller than the last, before it rests on the line. The in row is the same thing the other way round: small hops off the dim line that get taller, and then a drop to the green line. The in out row bounces away from the start and then into the end. No ball ever goes below the green line or above the dim one. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball drops to the green line like a dropped ball and bounces back up three times, each bounce smaller than the last, before it rests on the line. The in row is the same thing the other way round: small hops off the dim line that get taller, and then a drop to the green line. The in out row bounces away from the start and then into the end. No ball ever goes below the green line or above the dim one. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.
A real capture, 27 frames played in a loop - three small graphs, one above the other, labeled in, out and in out. In each one a ball moves steadily to the right while its height on the screen is the number being tweened: a dim dashed line at the top is where the number starts, a green dashed line below it is where it ends, and a trail of dots shows where the ball has been. In the out row the ball drops to the green line like a dropped ball and bounces back up three times, each bounce smaller than the last, before it rests on the line. The in row is the same thing the other way round: small hops off the dim line that get taller, and then a drop to the green line. The in out row bounces away from the start and then into the end. No ball ever goes below the green line or above the dim one. The first frame, which is all a viewer that cannot animate shows, is the finished picture: every dot, drawing the whole of each curve.

The same tween three ways, one row for each of EASE_BOUNCE_IN, EASE_BOUNCE_OUT and EASE_BOUNCE_IN_OUT. The ball's height is the number (like tween_to(y, ...) moving something down), and it drifts right at a steady speed only so that the shape can be seen. The dim line is where the number starts and the green line is where it ends: the ball touches the green line but never goes below it. Real pictures from a Game Boy Advance ROM, 4 frames apart, played at the speed of the console. A viewer that does not animate shows the first picture, the finished one.

Example

tween_to(y, y + 80, 60, EASE_BOUNCE_IN);

y grows downward, so the walker nudges down 1 pixel and back to its place, then 5 pixels and back, then 20 pixels and back, and then drops the rest of the 80 pixels and rests exactly there.

Good for something that gathers itself before it goes: a ball that bounces in place before it rolls away, or a menu item that jitters before it is picked. EASE_BOUNCE_OUT is the usual one.

See also: tweentween_totween_from_to